﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using HgRemoteContracts;

namespace HgRemoteServer.Config
{
	public class RepositoryTask : ConfigurationElement
	{
		[ConfigurationProperty("Name", IsKey = true, IsRequired = true)]
		public string Name
		{
			get { return this["Name"] as string; }
			set { this["Name"] = value; }
		}

		[ConfigurationProperty("Executable", IsRequired = true)]
		public string Executable
		{
			get { return this["Executable"] as string; }
			set { this["Executable"] = value; }
		}

		[ConfigurationProperty("Arguments", IsRequired = false)]
		public string Arguments
		{
			get { return this["Arguments"] as string; }
			set { this["Arguments"] = value; }
		}

		[ConfigurationProperty("StartIn", IsRequired = false)]
		public string StartIn
		{
			get { return this["StartIn"] as string; }
			set { this["StartIn"] = value; }
		}

		internal HgTask ToWcfTask()
		{
			return new HgTask() { Name = this.Name };
		}
	}
}
